//
//  CityWeather.swift
//  ZhiYunWeather
//
//  Created by Wade on 2024/7/9.
//

import Foundation
import UIKit
import LGSideMenuController
class KEMainVC : KYBaseVC ,UITableViewDelegate,UITableViewDataSource{
    lazy var menuList:Array = {
        return ["字母","单词","句子","自然阅读"]
    }()
    override func viewDidLoad() {
        self.view.backgroundColor = .MainBGColor
        self.navigationController?.setNavigationBarHidden(true, animated: false)
        setupSubViews()
    }
    

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        self.menuList.count
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = UITableViewCell()
        cell.textLabel?.text = self.menuList[indexPath.row]
        cell.textLabel?.font = .customFont(fontSize: 20)
        return cell
    }
    
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 80
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if indexPath.row == 0 {
            let detailVC = KEMenuDetail()
            detailVC.hidesBottomBarWhenPushed = true
            detailVC.title = self.menuList[indexPath.row]
            self.navigationController?.pushViewController(detailVC, animated: true)
        }else if indexPath.row == 1{
            let classiyListVC = KEClassifyVC()
            classiyListVC.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(classiyListVC, animated: true)
        }
        
    }
    
    
}
